#ifndef __OC_Mesh_H__
#define __OC_Mesh_H__

#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include "VAO.h"
#include "VBO.h"
#include "EBO.h"
#include "shaderClass.h"
#include "Camera.h"
#include "Texture.h"

namespace OCPP
{
	class _openGLExport Mesh
	{
	public:
		static Matrix4List defaultMatrix4List;
		Mesh(VertexList& vertices, IndiceList& indices,TextureList& textures,Matrix4List& instances = defaultMatrix4List);
		~Mesh();
		VertexList mVertexList;
		IndiceList mIndiceList;
		TextureList mTextureList;
		Matrix4List mInstances;
		// Draws the mesh
		void draw
		(
			Shader& shader,
			Camera& camera,
			Matrix4 matrix = Matrix4::IDENTITY
		);

		const Matrix4& getMatirx() { return mMatrix; }
		void setMatirx(Matrix4 matrix) { mMatrix = matrix; }

		VAO mVAO;
		VBO* mVBO;
		VBO* mVBOInc;
		EBO* mEBO;
		uint32 mIndiceCount;
		Matrix4 mMatrix = Matrix4::IDENTITY;
	};

	typedef std::shared_ptr<Mesh> MeshPtr;
	typedef std::vector<MeshPtr > MeshList;
}

#endif // !__OC_WINDOW_H__
